dataSource {
    pooled = true
	driverClassName = "com.mysql.jdbc.Driver"
	username = "root"
	password = "000000"
}
hibernate {
    cache.use_second_level_cache = true
    cache.use_query_cache = true
    cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory'
}
// environment specific settings
environments {
    development {
        dataSource {
            dbCreate = "update" // one of 'create', 'create-drop', 'update', 'validate', ''
            url = "jdbc:mysql://localhost/gappdb?useUnicode=true&characterEncoding=UTF-8"
        }
    }
    test {
        dataSource {
            dbCreate = "update"
            url = "jdbc:mysql://localhost/gappdb?useUnicode=true&characterEncoding=UTF-8"
        }
    }
    production {
        dataSource {
            dbCreate = "update"
            
            //def properties = PropertiesLoaderUtils.loadProperties(new ClassPathResource("ds.properties"))
            /*
						def properties = new Properties()
						properties.load(this.getClass().getResourceAsStream("ds.properties"));
						url =  properties.getProperty("url")
						driverClassName = properties.getProperty("driverClassName")
						username = properties.getProperty("username")
						password = properties.getProperty("password")
						//dialect = properties.getProperty("dialect")
						*/
						
            url = "jdbc:mysql://localhost/gappdb?useUnicode=true&characterEncoding=UTF-8"
            pooled = true
            properties {
               maxActive = -1
               minEvictableIdleTimeMillis=1800000
               timeBetweenEvictionRunsMillis=1800000
               numTestsPerEvictionRun=3
               testOnBorrow=true
               testWhileIdle=true
               testOnReturn=true
               validationQuery="SELECT 1"
            }
        }
    }
}
